<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%
	String path=request.getContextPath();
	String basePath=request.getScheme()+"://"
			+request.getServerName()+":"+request.getServerPort()
			+path+"/";
%>
<!DOCTYPE html>
<html>
<base href="<%=basePath%>">
	<head>
		<title>添加题目</title>
		<meta charset="utf-8">
		<link rel="icon" href="img/logo.png" sizes="32x32">
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css">
		<script type="text/javascript" src="layui/layui.js"></script>
	</head>
	<body>
		<c:if test="${addFlag }">
		<script type="text/javascript">
			layui.use('layer', function() {
				var layer = layui.layer;
				layer.msg('添加成功', { icon: 1, time: 1000, shade: [0.6, '#000', true] });
			});
		</script>
		</c:if>
		<div class="layui-anim layui-anim-up">
			<blockquote class="layui-elem-quote">
				<span>添加测试样例注意不必要的空格！！</span>
			</blockquote>
			<form class="layui-form" action="problem/add" id="form">
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
					<legend>添加题目信息</legend>
				</fieldset>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">标题</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="请输入标题" class="layui-textarea" name="problemTitle" id="problemTitle"></textarea>
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">内容</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="请输入内容" class="layui-textarea" name="problemContent" id="problemContent"></textarea>
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">输入格式</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="输入格式" class="layui-textarea" name="inputFormat" id="inputFormat"></textarea>
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">输出格式</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="输出格式" class="layui-textarea" name="outputFormat" id="outputFormat"></textarea>
					</div>
				</div>
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
					<legend>添加测试样例</legend>
				</fieldset>
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
					<legend style="font-size:14px;">测试样例1</legend>
				</fieldset>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">输入</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="输入样例" class="layui-textarea" name="inputItema" id="inputItema"></textarea>
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">输出</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="输出样例" class="layui-textarea" name="outputItema" id="outputItema"></textarea>
					</div>
				</div>
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
					<legend style="font-size:14px;">测试样例2</legend>
				</fieldset>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">输入</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="输入样例" class="layui-textarea" name="inputItemb" id="inputItemb"></textarea>
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">输出</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="输出样例" class="layui-textarea" name="outputItemb" id="outputItemb"></textarea>
					</div>
				</div>
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
					<legend style="font-size:14px;">测试样例3</legend>
				</fieldset>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">输入</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="输入样例" class="layui-textarea" name="inputItemc" id="inputItemc"></textarea>
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label" style="width: 40px;">输出</label>
					<div class="layui-input-block" style="margin-left: 70px;">
						<textarea placeholder="输出样例" class="layui-textarea" name="outputItemc" id="outputItemc"></textarea>
					</div>
				</div>
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
					<legend>设置其他信息</legend>
				</fieldset>
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">题目难度</label>
						<div class="layui-input-inline">
							<select name="levelId">
								<c:forEach var="problemLevel" items="${problemLevelList }">
									<option value="${problemLevel.getProblemLevelId() }">${problemLevel.getProblemLevelName() }</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">题目类别</label>
						<div class="layui-input-inline">
							<select name="typeId">
								<c:forEach var="problemType" items="${problemTypeList }">
									<option value="${problemType.getProblemTypeId() }">${problemType.getProblemTypeName() }</option>
								</c:forEach>
							</select>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">限制时间</label>
						<div class="layui-input-inline">
							<input type="text" name="limitTime" id="limitTime" lay-verify="limitTime" autocomplete="off" placeholder="请输入限定时间(ms)" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">空间限制</label>
						<div class="layui-input-inline">
							<input type="text" name="limitSpace" id="limitSpace" lay-verify="limitSpace" autocomplete="off" placeholder="请输入空间限制(MB)" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">题目来源</label>
						<div class="layui-input-inline">
							<input type="text" name="problemSource" id="problemSource" lay-verify="problemSource" autocomplete="off" placeholder="请输入题目来源" class="layui-input">
						</div>
					</div>
				</div>
				<div class="layui-form-item">
				    <div class="layui-input-block">
				      <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">发布</button>
				      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
				    </div>
				</div>
			</form>
		</div>
		<script type="text/javascript">
			layui.use('form', function() {
				var form = layui.form;
			});
		</script>
	</body>
</html>
